package com.kafka_demo.kafka;

import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * kafka消费者
 *
 * @author : z_sz
 * @date : 2020-09-03 10:49
 **/
@Component
public class KafkaConsumerManager {

    /**
     * 消息主体
     */
    private final String topic = "KAFKA_TEST";

    /**
     * 消息消费
     * @param message 监听到的消息
     */
    @KafkaListener(topics = {topic})
    public void consumer(String message) {
        System.out.println("消费者消费："+message);
    }

}
